<template>
    <div v-if="item.goods_id" class="goodsDetail" @click="$router.push(`/detail/${item.goods_id}`)">
        <div class="goods_photo">
            <img :src="item.goods_image" height="99%" width="150px">
        </div>
        <div class="goods_text">
            <p class="goods_name">{{item.goods_name}}</p>
            <div class="text_other">
                <p>已售{{ item.goods_sales }}</p>
                <p>
                    <span class="new_price">￥{{item.goods_price_min}}</span>
                    <del class="old_price">￥{{item.line_price_max}}</del>
                </p>
            </div>
        </div>
    </div>
</template>

<script>
export default {
  props: {
    item: {
      type: Object,
      default: () => {
        return {}
      }
    }
  }
//   created () {
//     console.log(this.item)
//   }
//
}
</script>

<style scoped>
    .goodsDetail{
        height: 190px;
        margin-bottom: 5px;
        padding: 5px;
        display: flex;
        font-size: 18px;
        color: #777;
        background-color: #faf6f6;
    }
    .goods_text{
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    .goods_name{
        font-size: 18px;
        color: black;
        /* p标签设置仅显示两行 */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .new_price{
        font-size: 25px;
        color: red;
    }
</style>
